using System;

using Gizmox.WebGUI.Common.Resources;
using System.Data;
using Gizmox.WebGUI.Forms;
using System.Collections;

namespace TVC
{
    /// <summary>
    /// Summary description for IHostedApplication.
    /// </summary>
    public interface IHostedApplication
    {
        void InitializeApplication();

        string GetTitle();

        void SetObject(object pbj);
        HostedToolBarElement[] GetToolBarElements();
        void OnToolBarButtonClick(HostedToolBarButton objButton, EventArgs objEvent);

        string GetLanguage();
    }

    #region HostedToolBarElements


    [Serializable()]
    public abstract class HostedToolBarElement
    {

    }


    [Serializable()]
    public class HostedToolBarSeperator : HostedToolBarElement
    {
    }



    [Serializable()]
    public class HostedToolBarButton : HostedToolBarElement
    {

        private ResourceHandle mobjImage = null;
        private string mstrToolTipText = "";
        private string mstrText = "";
        private object mobjTag = null;
        private bool enabled = true;

        public HostedToolBarButton(string strToolTipText, bool enabled = true)
            : this(strToolTipText, null, null, enabled)
        {
        }

        public HostedToolBarButton(string strToolTipText, ResourceHandle objImage, bool enabled = true)
            : this(strToolTipText, strToolTipText, objImage, null, enabled)
        {
        }

        public HostedToolBarButton(string strToolTipText, ResourceHandle objImage, object objTag, bool enabled = true)
            : this(strToolTipText, strToolTipText, objImage, objTag, enabled)
        {

        }

        public HostedToolBarButton(string strToolTipText, string strText, ResourceHandle objImage, object objTag, bool enabled = true)
        {
            this.mstrToolTipText = strToolTipText;
            this.mobjImage = objImage;
            this.mobjTag = objTag;
            this.mstrText = strText;
            this.enabled = enabled;
        }

        public ResourceHandle Image
        {
            get
            {
                return this.mobjImage;
            }
            set
            {
                this.mobjImage = value;
            }
        }

        public string ToolTipText
        {
            get
            {
                return this.mstrToolTipText;
            }
            set
            {
                this.mstrToolTipText = value;
            }
        }

        public string Text
        {
            get
            {
                return this.mstrText;
            }
            set
            {
                this.mstrText = value;
            }
        }


        public object Tag
        {
            get
            {
                return this.mobjTag;
            }
            set
            {
                this.mobjTag = value;
            }
        }

        public bool Enabled
        {
            get { return enabled; }
            set { enabled = value; }
        }
    }


    [Serializable()]
    public class HostedToolBarToggleButton : HostedToolBarButton
    {
        private bool mblnPushed = false;
        private string mstrGroup = "";

        public HostedToolBarToggleButton(string strToolTipText, bool enable = true)
            : base(strToolTipText, enable)
        {
        }

        public HostedToolBarToggleButton(string strToolTipText, ResourceHandle objImage, bool enable = true)
            : base(strToolTipText, objImage, enable)
        {
        }

        public HostedToolBarToggleButton(string strToolTipText, ResourceHandle objImage, object objTag, bool enable = true)
            : base(strToolTipText, objImage, objTag, enable)
        {

        }

        public HostedToolBarToggleButton(string strToolTipText, ResourceHandle objImage, object objTag, bool blnPushed, bool enable = true)
            : base(strToolTipText, objImage, objTag, enable)
        {
            mblnPushed = blnPushed;
        }

        public HostedToolBarToggleButton(string strToolTipText, ResourceHandle objImage, object objTag, string strGroup, bool enable = true)
            : base(strToolTipText, objImage, objTag, enable)
        {
            mstrGroup = strGroup;
        }

        public HostedToolBarToggleButton(string strToolTipText, string strText, ResourceHandle objImage, object objTag, bool enable = true)
            : base(strToolTipText, strText, objImage, objTag, enable)
        {

        }

        public HostedToolBarToggleButton(string strToolTipText, string strText, ResourceHandle objImage, object objTag, string strGroup, bool enable = true)
            : base(strToolTipText, strText, objImage, objTag, enable)
        {
            mstrGroup = strGroup;
        }

        public bool Pushed
        {
            get
            {
                return mblnPushed;
            }
            set
            {
                mblnPushed = value;
            }
        }

        public string Group
        {
            get
            {
                return mstrGroup;
            }
            set
            {
                mstrGroup = value;
            }
        }
    }

    [Serializable()]
    public class HostedToolBarDropDownButton : HostedToolBarElement
    {

        private ResourceHandle mobjImage = null;
        private string mstrToolTipText = "";
        private string mstrText = "";
        private object mobjTag = null;
        private bool enable = true;


        Gizmox.WebGUI.Forms.ContextMenu mobjContext = null;

        public Gizmox.WebGUI.Forms.ContextMenu ContextMenu
        {
            get { return mobjContext; }
            set { mobjContext = value; }
        }


        public HostedToolBarDropDownButton(string strToolTipText, ContextMenu menu, bool enable = true)
            : this(strToolTipText, null, null, menu, enable)
        {
        }

        public HostedToolBarDropDownButton(string strToolTipText, ResourceHandle objImage, ContextMenu menu, bool enable = true)
            : this(strToolTipText, "", objImage, null, menu, enable)
        {
        }

        public HostedToolBarDropDownButton(string strToolTipText, ResourceHandle objImage, object objTag, ContextMenu menu, bool enable = true)
            : this(strToolTipText, "", objImage, objTag, menu, enable)
        {

        }

        public HostedToolBarDropDownButton(string strToolTipText, string strText, ResourceHandle objImage, object objTag, ContextMenu menu, bool enable = true)
        {
            this.mstrToolTipText = strToolTipText;
            this.mobjImage = objImage;
            this.mobjTag = objTag;
            this.mstrText = strText;
            this.mobjContext = menu;
            this.enable = enable;
        }

        public ResourceHandle Image
        {
            get
            {
                return this.mobjImage;
            }
            set
            {
                this.mobjImage = value;
            }
        }

        public string ToolTipText
        {
            get
            {
                return this.mstrToolTipText;
            }
            set
            {
                this.mstrToolTipText = value;
            }
        }

        public string Text
        {
            get
            {
                return this.mstrText;
            }
            set
            {
                this.mstrText = value;
            }
        }


        public object Tag
        {
            get
            {
                return this.mobjTag;
            }
            set
            {
                this.mobjTag = value;
            }
        }
        public bool Enable
        {
            get { return enable; }
            set { enable = value; }
        }

    }
    #endregion
}
